<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->linkButton($this->__('system.button.forbid'), "submitGridChecked('grid', '".$this->buildUrl('*/*/*/forbid')."')"));
echo $t->renderItem($this->link($this->__('system.button.new'), $this->buildUrl('*/*/*/create')));
echo $t->renderEnd();

$this->nextBlock('grid');
$g = $this->grid('grid', $this->list->toArray());
echo $g->renderBegin();
echo $g->renderHeadBegin();
echo $g->emptyHead()->setStyle('width', 30);
echo $g->htmlHead($this->checkbox()->addClass('row-all-check')->toHtml())->setStyle('width', 30);
echo $g->labelHead($this->__('system.label.name'))->setStyle('width', 150)->toHtml();
echo $g->labelHead($this->__('system.label.domain_name'))->setStyle('width', 100)->toHtml();
echo $g->labelHead($this->__('system.label.enter_url'))->setStyle('width', 100)->toHtml();
echo $g->labelHead($this->__('system.label.default'))->setStyle('width', 40)->toHtml();
echo $g->labelHead($this->__('system.label.description'))->toHtml();
echo $g->labelHead($this->__('system.label.status'))->setStyle('width', 100)->toHtml();
echo $g->emptyHead()->setStyle('width', 40);
echo $g->renderHeadEnd();
while($g->nextRow()):
    $currentRow = $g->getCurrentRow();
	echo $g->renderRowBegin();
	echo $g->indexCell()->toHtml();
	echo $g->checkboxCell('{id}', 'ids[]')->addClass('row-check')->toHtml();
	echo $g->labelCell('{name}')->toHtml();
    echo $g->labelCell('{domain_name}')->toHtml();
    echo $g->labelCell('{enter_url}')->toHtml();
    $cell = $g->booleanCell('{is_default}');
    echo $cell->renderBegin().$cell->renderChildren();
    if($currentRow['is_default'] == FALSE):
    echo '&nbsp;<a href="'.$this->buildUrl('*/*/*/default', array('id'=>$currentRow['id'])).'">'.$this->__('system.label.default').'</a>';
    endif;
    echo $cell->renderEnd();
    echo $g->labelCell('{description}')->toHtml();
    echo $g->statusLabelCell('{status}')->toHtml();
    echo $g->linkCell($this->__('system.button.modify'), $this->buildUrl('*/*/*/edit', array('id'=>'{id}')))
            ->setStyle('text-align', 'center')
            ->toHtml();    
	echo $g->renderRowEnd();
endwhile;
echo $g->renderEnd();

$this->nextBlock('pagination');
echo $this->pagination($this->recordCount)->toHtml();
$this->endBlock();

echo $this->extend('template'.DS.'list');